package org.hhchat.leetcode.string;

public class code657_easy {

    static class Solution {
        int x=0;
        int y=0;
        public boolean judgeCircle(String moves) {
            for(Character c:moves.toCharArray()){
                if(c.equals('U')){
                    y++;
                }else if(c.equals('D')){
                    y--;
                }else if(c.equals('L')){
                    x--;
                }else{
                    x++;
                }
            }
            return x == 0 && y == 0;
        }
    }

    public static void main(String[] args){
        Solution solution = new Solution();
        System.out.println(solution.judgeCircle(""));
    }
}
